home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / snpd1292.zip / RMLEAD.C < prev    next >
C/C++ Source or Header  |  1992-12-26  |  532b  |  27 lines

  1. /*
  2. **  Originally published as part of the MicroFirm Function Library
  3. **
  4. **  Copyright 1986, S.E. Margison
  5. **  Copyright 1989, Robert B.Stout
  6. **
  7. **  Subset version released to the public domain, 1991
  8. **
  9. **  remove leading whitespace from a string
  10. */
  11.  
  12. #include <ctype.h>
  13. #include <string.h>
  14.  
  15. #define NUL '\0'
  16.  
  17. char *rmlead(char *str)
  18. {
  19.       char *obuf;
  20.  
  21.       for (obuf = str; obuf && *obuf && isspace(*obuf); ++obuf)
  22.             ;
  23.       if (str != obuf)
  24.             strcpy(str, obuf);
  25.       return str;
  26. }
  27.